package com.gl.emms.whale.util;


import android.content.Context;
import android.content.SharedPreferences;

public class HeartBeatInfoSaveUtil {
	private SharedPreferences sp;
	private SharedPreferences.Editor editor;

	public HeartBeatInfoSaveUtil(Context context) {
		sp = context.getSharedPreferences("heartbeat", context.MODE_PRIVATE);
		editor = sp.edit();
	}
	public void setHeartBeatInfo(String idip,boolean isOnline,String name){
		setIdip(idip);
		setIsOnline(isOnline);
		setName(name);
	}
	// 设置idip
	public void setIdip(String idip) {
		editor.putString("idip", idip);
		editor.commit();
	}

	// 设置名字
	public void setName(String name) {
		editor.putString("name", name);
		editor.commit();
	}
	// 是否在线
	public void setIsOnline(boolean isOnline) {
		editor.putBoolean("isOnline", isOnline);
		editor.commit();
	}

}
